package com.bootdo.mall.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.bootdo.mall.dao.MallCateGoryDao;
import com.bootdo.mall.domain.MallCateGory;
import com.bootdo.mall.service.MallCateGoryService;



@Service
public class MallCateGoryServiceImpl implements MallCateGoryService {
	@Autowired
	private MallCateGoryDao mallCateGoryDao;
	
	@Override
	public MallCateGory get(Integer id){
		return mallCateGoryDao.get(id);
	}
	
	@Override
	public List<MallCateGory> list(Map<String, Object> map){
		return mallCateGoryDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return mallCateGoryDao.count(map);
	}
	
	@Override
	public int save(MallCateGory mallCateGory){
	
		if(mallCateGory.getId() != null) {
			return mallCateGoryDao.update(mallCateGory);
		}else {
			return mallCateGoryDao.save(mallCateGory);
		}		
	
		
	}
	
	@Override
	public int update(MallCateGory mallCateGory){
		return mallCateGoryDao.update(mallCateGory);
	}
	
	@Override
	public int remove(Integer id){
		return mallCateGoryDao.remove(id);
	}
	
	@Override
	public int batchRemove(Integer[] ids){
		return mallCateGoryDao.batchRemove(ids);
	}
	
}
